import com.gmongo.GMongo
import com.db.Config;
def mongo = new GMongo(Config.dbip,Config.dbport)
def db = mongo.getDB(Config.dbname)
def user=request.getParameter('user')
if(user==null||user.length()==0){
	//使用key删除Email地址
	db.(Config.SENDER_EMAIL_MESSAGE).remove(key:request.getParameter('key'))
	println "del: key"
}else{
	//链接数据库
	
	if(user=='all'){
		db.(Config.SENDER_EMAIL_MESSAGE).remove([:])
		println 'del:all'
	}else{
		println 'del:'
		(db.(Config.SENDER_EMAIL_MESSAGE).find(user:user)).each{ println it
		}
		db.(Config.SENDER_EMAIL_MESSAGE).remove(user:user)
	}
}






